package com.nuc.kl.module.usermanager.dao.impl;

import org.hibernate.Query;
import org.springframework.stereotype.Repository;

import com.nuc.kl.base.DaoSupportImpl;
import com.nuc.kl.module.usermanager.dao.UserDao;
import com.nuc.kl.module.usermanager.entity.User;

@Repository
public class UserDaoImpl extends DaoSupportImpl<User> implements UserDao{

	public Long countUser() {
		
		String sql = "SELECT COUNT(*) FROM kl_user";
		
		Query query = getSession().createSQLQuery(sql);
		
		return 	((Number)query.uniqueResult()).longValue();
	}
	
}
